import request from "@/utils/request";
import { method } from "lodash";
interface IAddTrsk {
  assignorId: number
  createType: number
  desc: string
  details: Array<GoodList>
  innerCode: string
  productType: number
  userId: number
}
interface GoodList {
  channelCode?: string
  detailsId?: string
  expectCapacity?: number
  skuId?: string
  skuImage?: string
  skuName?: string
  taskId?: string
}
export const GettaskList = () => request({ url: 'api/task-service/taskType/list' })
//
export const GetSearch = (pageIndex: number, pageSize: number, isRepair: Boolean) => request({ url: `api/task-service/task/search?pageIndex=${pageIndex}&pageSize=${pageSize}&isRepair=${isRepair}` })
//整体分页列表
export const GetDeilList = (id: string) => request({ url: `api/task-service/task/taskInfo/${id}` })
//详情列 列表
export const GetGoodList = (id: string) => request({ url: `api/task-service/taskDetails/${id}` })
//获取商品列表
export const GETCordon = () => request({ url: 'api/task-service/task/supplyAlertValue' })
export const SETCordon = (alertValue: number) => request({ url: 'api/task-service/task/autoSupplyConfig', data: { alertValue }, method: 'post' })
//设置警戒线
export const PersonList = (innerCode: string) => request({ url: `api/user-service/user/operatorList/${innerCode}` })
//获取人员列表
export const CreateTask = (data: IAddTrsk) => request({ url: 'api/task-service/task/create', method: 'post', data })
//重新创建
export const RemoveTask = (taskId: string, desc: string) => request({ url: `api/task-service/task/cancel/${taskId}`, method: 'post', data: { taskId, desc } })
//取消创建
export const SearchTaskinfo = (status: number, pageIndex: number) => request({ url: `api/task-service/task/search?pageIndex=${pageIndex}&pageSize=10&status=${status}&isRepair=false` })
//精准搜索api/vm-service/channel/channelList/01000024
export const GoodinnerCode = (innerCode: string) => request({ url: `api/vm-service/channel/channelList/${innerCode}` })
//查询此区域商品
export const SearchtaskCode = (taskCode: number) => request({ url: `api/task-service/task/search?pageIndex=1&pageSize=10&taskCode=${taskCode}&isRepair=false` })
//查询taskCode列表